# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:       加一
# Name:         demo3.07
# Description:  循环
# Author:       加一
# Date:         2019/1/22
#-------------------------------------------------------------------------------

print(1,end=" ")
print(2,end=" ")
print(3,end=" ")
print(4,end=" ")
print(5,end=" ")
print(6,end=" ")
print(7,end=" ")
print(8,end=" ")
print(9,end=" ")
print(10)

# 用while循环输出1~10
print("用while循环输出1~10")
x = 1
while x <= 10:
    print(x,end=" ")
    x += 1

    # 定义一个列表
    numbers = [1,2,3,4,5,6,7,8,9,10]
    print("\n用for循环输出列表中的值（1~10）")
    for num in numbers:
        print(num,end=" ")

        # 用range函数生成一个元素从1~9999的列表
        numbers = range(1,10000)
        print("\n用for循环输出列表中的值（1~9999）")
        for num in numbers:
            print(num, end=" ")
            print("\n用for循环输出列表中的值的乘积（1~99）")
            # 用range函数生成一个元素值为0~99的列表，并对该列进行迭代
            for num in range(100):
                print(num * num, end= " ")